<layout name="page" />
<block name="content">
	{:widget('page_header/simple',array('name'=>'编辑:'.$vo['name']))}
<div class="frame">
	<form method='post' id="form_data" name="form_data" enctype="multipart/form-data"  >
		<input type="hidden" id="scope_user_id" name="scope_user_id" value="{$vo.scope_user_id}">
		<input type="hidden" id="scope_user_name" name="scope_user_name" value="{$vo.scope_user_name}">
		<input type="hidden" id="ajax" name="ajax" value="0">
		<input type="hidden" id="id" name="id" value="{$vo.id}">	
		<input type="hidden" id="opmode" name="opmode" value="edit">

		
			<label class="input-label" for="name">标题：</label>
			
				<input type="text" id="name" name="name" value="{$vo.name}" class="input"  check="required" info="请输入标题">
			</div>
		</div>
		
				<label class="input-label" for="location">发布范围：</label>
				
					<div id="actor_wrap" class="input-box">
						<div class="wrap" >
							<span class="address_list">{$vo.scope_user_name||show_contact="edit"}</span>
							<span class="text" >
								<input class="letter" type="text"  >
							</span>
						</div>
						<div class="search dropdown ">
							<ul class="dropdown-menu"></ul>
						</div>
						<a class="add-on" id="select_actor"><i class="fa fa-user"></i> </a>
					</div>
				</div>
		</div>

		

		
			<label class=" input-label" for="content">信息内容：</label>
			
				<textarea  class="editor" id="content" name="content" style="width:100%;height:300px;" check="required" info="请输入内容">{$vo.content}</textarea>
			</div>
		</div>

		
			<label class="input-label">附件：</label>
		
				{:widget('file_upload/edit',array('add_file'=>$vo['add_file']))}
			</div>
		</div>
		
			
				<a class="btn btn-normal" onclick="save()">保存</a>
				<a  class="btn btn-return" onclick="go_return_url();">取消</a>
			</div>
		</div>
	</form>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		layui.use([ 'global','editor'], function() {
			var $ = layui.jquery;
			$('#select_actor').on('click', function() {
				winopen("{:url('Popup/scope')}", 560, 470);
			});
			$("#btn_save").on('click', function() {
				$("#scope_user_name").val("");
				$("#actor_wrap span.address_list span").each(function() {
					$("#scope_user_name").val($("#scope_user_name").val() + $(this).text().replace(';', '') + '|' + $(this).attr("data") + ";");
				});

				$("#scope_user_id").val("");
				$("#actor_wrap span.address_list span").each(function() {
					$("#scope_user_id").val($("#scope_user_id").val() + $(this).attr("data") + ",");
				});
				send_form('form_data', "{:url('save')}", '', function() {

				});
			});
			$(function() {
				set_val('is_sign', "{$vo.is_sign}");
				set_val('is_public', "{$vo.is_public}");
			});
			$(document).on("click", ".inputbox .address_list a.del", function() {
				$(this).parent().parent().remove();
			});
		});
	</script>
</block>